package sz.szsmk.citizencard.ui.newversion.activity

import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.chenenyu.router.annotation.Route
import com.flyco.tablayout.listener.CustomTabEntity
import com.gyf.immersionbar.ImmersionBar
import com.gyf.immersionbar.ktx.immersionBar
import kotlinx.android.synthetic.main.fragment_cardlist.*
import sz.szsmk.citizencard.R
import sz.szsmk.citizencard.ui.dzsmkavtivity.AppBaseActivity
import sz.szsmk.citizencard.ui.newversion.bean.TabEntity
import sz.szsmk.citizencard.ui.newversion.config.Constants
import sz.szsmk.citizencard.ui.newversion.fragment.adapter.CardListTabAdapter
import java.util.ArrayList

/**
 *  author : hyt
 *  date : 2020/8/18
 *  description : 卡包
 */
@Route(Constants.CARDLIST)
class CardListActivity : AppBaseActivity() {

    override fun getTopTitle() = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.fragment_cardlist)

        //沉浸
        immersionBar{
            reset()
            statusBarDarkFont(false)
        }

        //手动 空出 状态栏高度
        var layoutParams = toolbar.layoutParams as RelativeLayout.LayoutParams
        layoutParams.setMargins(0, ImmersionBar.getStatusBarHeight(this),0,0)
        toolbar.layoutParams = layoutParams

        //初始化 tab 和 viewpager
        //几个Fragment 在 CardListTabAdapter 里面
        val sectionsPagerAdapter =  CardListTabAdapter(this, supportFragmentManager)
        view_pager.adapter = sectionsPagerAdapter

        val mFilter = arrayOf(
                getString(R.string.coupon),
                getString(R.string.ticket),
                getString(R.string.cards))
//        ctl_filter.setViewPager(view_pager,mFilter)

        back.setOnClickListener { finish() }




    }
}